package com.twang.stock.controller.common;

import com.twang.stock.dto.BaseRequest;
import com.twang.stock.service.IndexService;
import com.twang.stock.service.TodayQinXuService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
@RequestMapping(value = "/")
@Slf4j
public class IndexNewController {

    @Autowired
    private IndexService indexService;

    @Autowired
    private TodayQinXuService todayQinXuService;


    @RequestMapping(value = "/index0415")
    public ModelAndView bigData(BaseRequest request) throws Exception {
        ModelAndView modelAndView = new ModelAndView();
        indexService.indexDataInit(modelAndView);
        modelAndView.setViewName("pages/graph_metrics");
        return modelAndView;
    }


    @RequestMapping(value = "/fupan")
    public ModelAndView fupan(BaseRequest request) throws Exception {
        ModelAndView modelAndView = new ModelAndView();
        indexService.indexDataInit(modelAndView);
        todayQinXuService.zhangTingBanQuery(modelAndView);
        modelAndView.setViewName("pages/a_fupan");
        return modelAndView;
    }

    @RequestMapping(value = "/index_V4")
    public ModelAndView indexV4(BaseRequest request) throws Exception {
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("pages/index_V4");
        return modelAndView;
    }
}
